var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }(d == 1) ? status++ : status--;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            随机 = Math.floor(Math.random() * 20);
            if (随机 < 15) {
                cm.gainItem(2435770, 2);
                cm.playerMessage(-1, " " + cm.getItemName(2435770) + " x2 ")
            } else {
                cm.gainItem(2435770, 5);
                cm.playerMessage(-1, " " + cm.getItemName(2435770) + " x5 ")
            }
            cm.dispose()
        }
    }
};